db0c944aad4834f475888d29415fc60c92184e0c,kie-infinispan/drools-infinispan-persistence/src/main/java/org/drools/persistence/infinispan/KnowledgeStoreServiceImpl.java,KnowledgeStoreServiceImpl,loadKieSession,#number#KieBase#KieSessionConfiguration#Environment#,96
Before Change
throw new IllegalArgumentException( "Environment cannot be null" );
}
CommandService commandService = (CommandService) buildCommandService( new Long(id), kbase, mergeConfig( configuration ), environment );
if (commandService instanceof SingleSessionCommandService) {
((SingleSessionCommandService) commandService).
addInterceptor(new ManualPersistInterceptor((SingleSessionCommandService) commandService));
try {
Class<?> clazz = Class.forName("org.jbpm.persistence.ManualPersistProcessInterceptor");
Constructor<?> c = clazz.getConstructor(SingleSessionCommandService.class);
Interceptor interceptor = (Interceptor) c.newInstance(commandService);
((SingleSessionCommandService) commandService).addInterceptor(interceptor);
} catch (ClassNotFoundException e) {
//Expected of non-jbpm based projects
} catch (Exception e) {
//something unexpected happened
throw new RuntimeException("Something wrong initializing manual process persistor interceptor", e);
}
}
return new CommandBasedStatefulKnowledgeSession( commandService );
}
public StatefulKnowledgeSession loadKieSession(Long id,
After Change
throw new IllegalArgumentException( "Environment cannot be null" );
}
CommandExecutor commandService = buildCommandService( new Long(id), kbase, mergeConfig( configuration ), environment );
if (commandService instanceof SingleSessionCommandService) {
((PersistableRunner) commandService).addInterceptor(new ManualPersistInterceptor((SingleSessionCommandService) commandService));
try {
Class<?> clazz = Class.forName("org.jbpm.persistence.ManualPersistProcessInterceptor");
Constructor<?> c = clazz.getConstructor(PersistableRunner.class);
ChainableRunner interceptor = (ChainableRunner) c.newInstance(commandService);
((PersistableRunner) commandService).addInterceptor(interceptor);
} catch (ClassNotFoundException e) {
//Expected of non-jbpm based projects
} catch (Exception e) {
//something unexpected happened
throw new RuntimeException("Something wrong initializing manual process persistor interceptor", e);
}
}
return new CommandBasedStatefulKnowledgeSession( (ExecutableRunner) commandService );
}
public StatefulKnowledgeSession loadKieSession(Long id,